#include <iostream>
#include <cstdio>
#include <time.h>

/**
 * this class is used to record how long a program cost
 * just declare a timer object in the first line of your program
 * then use the totalTime function to print the time in the last of your program
 */
class Timer {

private:
  clock_t startTime;
  clock_t endTime;

public:
  Timer() {
    startTime = clock();
  }
  
  void totalTime() {
    endTime = clock();
    std::cout << "Total time: " << (endTime - startTime) << " (ms)" << std::endl;
  }
};
